import java.util.Date;

class TimeInstant{
	
    public int hour, minutes, seconds, day, month, year;
    
    public TimeInstant(){
	this.hour = -1;
	this.minutes = -1;
	this.seconds = -1;
	this. day = -1;
	this.month = -1;
	this.year = -1;	
    }
    
    public TimeInstant(int hour, int minutes, int seconds, int day, int month, int year){
	this.hour = hour;
	this.minutes = minutes;
	this.seconds = seconds;
	this.day = day;
	this.month = month;
	this.year = year;
    }
    

    public boolean beforeNow(){
	
	//right now
	Date now = new Date();
	
	Date tmp = new Date(now.getTime());
	
	if(this.year != -1)
	    tmp.setYear(this.year-1900);
	if(this.month != -1)
	    tmp.setMonth(this.month-1);
	if(this.day !=-1)
	    tmp.setDate(this.day);
	if(this.hour != -1)
	    tmp.setHours(this.hour);
	if(this.minutes != -1)
	    tmp.setMinutes (this.minutes);
	if(this.seconds != -1)
	    tmp.setSeconds(this.seconds);

	if(tmp.getTime() <= now.getTime())
	    return true;
	else return false;
	
    }//end beforeNow
    
    public boolean afterNow(){
	
	//right now
	Date now = new Date();
	
	Date tmp = new Date(now.getTime());
	
	if(this.year != -1)
	    tmp.setYear(this.year-1900);
	if(this.month != -1)
	    tmp.setMonth(this.month-1);
	if(this.day !=-1)
	    tmp.setDate(this.day);
	if(this.hour != -1)
	    tmp.setHours(this.hour);
	if(this.minutes != -1)
	    tmp.setMinutes (this.minutes);
	if(this.seconds != -1)
	    tmp.setSeconds(this.seconds);

	if(tmp.getTime() >= now.getTime())
	    return true;
	else return false;
	
    }//end beforeNow

}//end class
